Skip to content

feat(api): multi-stage Dockerfile for gRPC API crate#29

Merged
Depo-dev merged 8 commits into
devfrom
feat/issue-13-grpc-api-dockerfile
Jun 19, 2026
Merged

feat(api): multi-stage Dockerfile for gRPC API crate#29
Depo-dev merged 8 commits into
devfrom
feat/issue-13-grpc-api-dockerfile

Conversation

@Depo-dev

@Depo-dev Depo-dev commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Multi-stage Dockerfile at crates/api/Dockerfile: rust:1.78-slim builder (with protoc for tonic-build) + debian:bookworm-slim runtime
  • Dependency layer cached separately; proto/ and source copied after the dummy-source dep build
  • Binary runs as non-root trident user, exposes port 50051
  • Extends CI docker-build job to also build trident-api:ci

Test plan

  • docker build -f crates/api/Dockerfile . succeeds locally
  • Final image < 100 MB
  • CI docker-build job passes on this PR

Closes #13

@Depo-dev Depo-dev force-pushed the feat/issue-13-grpc-api-dockerfile branch from 3171091 to b68f3fb Compare June 19, 2026 15:51
Depo-dev added 8 commits June 19, 2026 17:32
…ild job

Multi-stage build: rust:1.78-slim builder installs protoc, compiles
trident-api in release mode with dependency caching; debian:bookworm-slim
runtime copies only the binary and runs as non-root trident user on
port 50051. Extends the CI docker-build job to also build the gRPC API
image using GitHub Actions layer cache.
… Docker builder

sqlx uses runtime-tokio-native-tls which links against OpenSSL.
protoc-bin-vendored supplies its own protoc binary so the system
protobuf-compiler package is not needed.
Transitive deps (home 0.5.12, icu_collections 2.2.0) require rustc 1.88;
rust:1.85-slim no longer satisfies MSRV.

The indexer Dockerfile lives on feat/issue-9-indexer-dockerfile, not this
branch, so the Build indexer image step would always fail with file-not-found.
After the dep-caching step removes crates/indexer/src, cargo fails to resolve
the workspace manifest for the indexer member on the second build pass.
Recreating a minimal dummy main.rs satisfies the workspace.
feat/issue-9-indexer-dockerfile was merged into dev, so crates/indexer/Dockerfile
now exists. The earlier commit that dropped this step pre-dated the merge;
add it back so all three images are built in CI.
@Depo-dev Depo-dev force-pushed the feat/issue-13-grpc-api-dockerfile branch from 025770b to 17012a2 Compare June 19, 2026 16:33
@Depo-dev Depo-dev merged commit 74e5f2a into dev Jun 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant